#ifndef BUTTON_H
#define BUTTON_H

#include <QPushButton>
#include <QKeyEvent>
#include <QLayout>
#include <QWidget>
#include <QSettings>
#include "pictureviewpage.h"
#include <QGSettings>

#define FITTHEMEWINDOW "org.ukui.style"


class Button : public QWidget
{
  Q_OBJECT
public:
    explicit Button(QWidget *parent = 0);
    ~Button();
    void CreatButton();
    QLabel *picture;
    QPushButton *capture;
    QPushButton *video;
    QPushButton *cheese;   //拍照 白天主题
    QPushButton *cheese_dark; //拍照 黑夜主题
    //QPushButton *picture;
    QPushButton *Burst;  //连拍
    QPushButton *scale;
    QPushButton *voice;
    QPushButton *Setting;
    QPushButton *stop;
    QPushButton *cheese_video; // 录像开始
    QPushButton *cheese_stop;  // 录像结束
    QPushButton *restore;   //恢复
    QPushButton *delay;
    QPushButton *grid;
    QPushButton *layout;
    QPushButton *mirror;
    QLabel *aboutMail_1 = nullptr; //lhl debug

    static bool delay_mode;  //延迟拍照模式
    static bool video_mode;  //录像模式
    static bool video_start; //录像开启
    static bool voice_mode;
    static bool Burst_mode;  //滤镜模式
    static bool picturepage_show; //相册显示
    static QGSettings *m_pGsettingTheme;
signals:
protected:
    virtual void paintEvent(QPaintEvent *);

public slots:
    void capture_click();
    void video_click();
    void cheese_click();
    void cheese_dark_click();
    void picture_click();
    void Burst_click();
    void scale_click();
    void stop_click();
    void voice_click();
    void cheese_video_click();
    void cheese_stop_click();
    void restore_click();
    void focusInEvent();
    void dealSystemGsettingChange(const QString);
    void refreshThemeBySystemConf();
private slots:

private:
    QHBoxLayout *switchLayout;
    QHBoxLayout *btnLayout;
    QVBoxLayout *vLayout;
    QSettings *set = new QSettings;
    QString nowThemeStyle;

};

#endif // BUTTON_H
